<?php
class Myblog_Form_Search extends Zend_Form
{
	public function init(){
	$this->setAction('/catalog/index/search')
		->setName('form')
        ->setAttrib('style','padding:0')
		->setMethod('POST');

	
	$search=new Zend_Form_Element_Text('search');
	$search->setLabel('Поиск:')
		->setOptions(array('size'=>'12'))
		->addValidator('Alnum')
		->addValidator('Alpha')
		->addFilter('HtmlEntities')
		->addFilter('StringTrim')
		->addFilter('StripTags');
	$search->setDecorators(array(
		array('ViewHelper'),
		array('Errors'),
		array('Label',array('tag'=>'span')),
	));

	$submit=new Zend_Form_Element_Submit('submit');
	$submit->setLabel('')
		->setOptions(array('class'=>'buttonSearch'));
	$submit->setDecorators(array(
		array('ViewHelper'),
	));
	$submit->removeDecorator('Label');

    $this->setDecorators(array(
                         'FormElements',
                          array('HtmlTag', array('dl' => 'div')),
                          'Form',
                         ));

	$this->addElements(array($search,$submit));
	}
}
?>
